<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    // decodeURI 进行url的解码
    console.log(location.search)
    var name = decodeURI(location.href)
    console.log(name)
    // * 可以使用encodeURIComponent()和decodeURIComponent()来进行转义

  </script>

</html>